#ifndef __OTA_HTTP_H__
#define __OTA_HTTP_H__

#include <curl/curl.h>
#include "stdlib.h"
#include "log.h"
#include "string.h"

#define OTA_JSON_PATH "http://192.168.42.41:8000/fileinfo.json"
#define OTA_FILE_PATH "http://192.168.42.41:8000/download/gateway"
#define OTA_FILE_NAME "/home/lbs/gateway.download"

/**
 * @brief 获取json数据
 * 
 * @param url 路径
 * @return char* json 数据
 */
char *ota_http_getJson(char *url);
/**
 * @brief 下载文件
 * 
 * @param url 路径
 * @param filename 指定路径
 * @return int 0 成功 -1 失败
 */
int ota_http_dowload(char *url, char *filename);

#endif
